import request from '@/utils/request.js';


export function getList(data) {
  return request({
    url: `/sysDictionary/list`,
    method: 'post',
    data,
  });
}

export function getItem(id) {
  return request({
    url: `/sysDictionary/getIem`,
    method: 'get',
    params: {
      id,
    },
  });
}

export function update(data) {
  return request({
    url: `/sysDictionary/update`,
    method: 'post',
    data,
  });
}

export function add(data) {
  return request({
    url: `/sysDictionary/add`,
    method: 'post',
    data,
  });
}


export function del(id) {
  return request({
    url: `/sysDictionary/delbyid`,
    method: 'get',
    params: { id },
  });
}

// 查询日志
export function getLogs(data) {
  return request({
    url: '/sysDictionary/getlogs',
    method: 'post',
    data: data,
  });
}

export function getJsonbyBnpmId(data) {
  return request({
    url: '/sysDictionary/getpipelineandlinelist',
    method: 'get',
    params: {
      ...data,
      bpmId: data.bpmId,
    },
  });
}


export function delNode(id) {
  return request({
    url: '/sysDictionary/delpipeline',
    method: 'get',
    params: { id },
  });
}

export function delLine(id) {
  return request({
    url: '/sysDictionary/dellinebyid',
    method: 'get',
    params: { id },
  });
}


//开启流程
export function startDevelopment(row) {
  return request({
    url: '/mes-liumingtai/plmProductDevelopmentPipeline/startDevelopment',
    method: 'post',
    data: {
      ...row,
      bpmnId: row.bpmnId,
    },
  });
}
